<template>
	<view>
		<!-- 搜索 -->
		<view class="search">
			<u-search :showAction="flase"></u-search>
		</view>
		<!-- 关注 发现 -->
		<view class="select">
			<u-tabs :list="list1" :current="current" @change="changeindex" lineWidth="30" lineColor="#f56c6c"
				:activeStyle="{
			    color: '#f56c6c',
			    fontWeight: 'bold',
			    transform: 'scale(1.05)',
				fontsise:'28rpx'
			}" :inactiveStyle="{
			    color: '#606266',
			    transform: 'scale(1)'
			}" itemStyle="padding-left: 30rpx; padding-right: 30rpx; height: 68rpx;"></u-tabs>
		</view>
		<view style="background-color: #F6F6F6; height: 100vh; width: 100vw; ">
			<view class="box">

			</view>
		</view>
		<tab-bar></tab-bar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list1: [{
					name: '关注'
				}, {
					name: '发现'
				}, {
					name: '地图'
				}],
				current: 0,
			};
		},
		methods: {
			changeindex(index) {
				let f = this.current
				this.current = index.index;
				console.log(this.current)
				if (this.current == 2) {
					this.current = f
					this.gotomap()
				}
				if (this.current == 1) {
					this.gotohome()
					console.log("去home")
				}
				//如报错则用this.current = index代替上行
			},
			gotohome() {
				uni.switchTab({
					url: "/pages/home/home"
				})
			},
			gotomap() {
				uni.navigateTo({
					url: "/pages/map/map"
				})
			}
		}
	}
</script>

<style lang="scss">
	.search {
		display: block;
		margin: auto;
		text-align: center;
		width: 92%;
	}

	.slideshow {
		display: block;
		margin: auto;
		margin-top: 10rpx;
		text-align: center;
		width: 80%;
	}

	.select {
		display: flex;
		justify-content: center;

		.u-tabs__wrapper__nav__item__text.data-v-48634e29 {
			font-size: 36rpx;
		}
	}

	.box {
		margin: 20rpx;
		border-radius: 20rpx;
		display: flex;
		align-items: center;
		width: 95%;
		height: 300rpx;
		box-shadow: rgba(14, 30, 37, 0.12) 0px 2px 4px 0px, rgba(14, 30, 37, 0.32) 0px 2px 16px 0px;
	}
</style>